//
//  Compilation.h
//  Map
//
//  Created by peoit-xq on 15/12/28.
//  Copyright © 2015年 apple. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <AMapSearchKit/AMapSearchKit.h>
#import "Map.h"
typedef void(^MapCompilationWithLocationBlock)(NSString *address);
typedef void(^MapCompilationWithAddressBlock)(CLLocation *location);
typedef void(^MapPOIKeywordsSearchBlock)(NSArray *array);
@protocol MapManangerDelegate;

@interface MapMananger : NSObject

@property (nonatomic,assign)id<MapManangerDelegate>delegate;
/**
 *  指定城市，为空表示全国
 */
@property (nonatomic, strong)NSString *userCity;

- (instancetype)init;


/**
 *  反编译
 */
- (void)AntiCompilationWithLocation:(CLLocation *)location;

/**
 *  反编译block
 */
- (void)AntiCompilationWithLocation:(CLLocation *)location completion:(MapCompilationWithLocationBlock)completion;

/**
 *  地理编码
 */
- (void)CompilationWithAddress:(NSString *)address;

/**
 *  地理编码block
 */
- (void)CompilationWithLocation:(NSString *)address completion:(MapCompilationWithAddressBlock)completion;

/**
 *  关键字搜索block
 *  返回的数据以数组的形式存储
 */
- (void)POIKeywordsSearchWithString:(NSString *)string completion:(MapPOIKeywordsSearchBlock)completion;



@end



#pragma mark CompilationDelegate
@protocol MapManangerDelegate <NSObject>
/**
 * 反编译
 */
- (void)compilation:(MapMananger *)com returnAntiCompilationResult:(NSString *)address;
/**
 *  地理编码
 */
- (void)compilation:(MapMananger *)com returnCompilationResult:(CLLocation *)location;


@end
